{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Accessing data from a website\n",
    "Not all websites make it easy to grab data. Luckily, `pandas` can help."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Common and formal names</th>\n",
       "      <th>Membership within the UN System[a]</th>\n",
       "      <th>Sovereignty dispute[b]</th>\n",
       "      <th>Further information on status and recognition of sovereignty[d]</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>UN member states and observer states ↓</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Abkhazia</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Afghanistan – Islamic Republic of Afghanistan</td>\n",
       "      <td>UN member state</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Albania – Republic of Albania</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Algeria – People's Democratic Republic of Algeria</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Andorra – Principality of Andorra</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Andorra is a co-principality in which the offi...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Angola – Republic of Angola</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Antigua and Barbuda</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Antigua and Barbuda is a Commonwealth realm[e]...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Argentina – Argentine Republic[g]</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Argentina is a federation of 23 provinces and ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Armenia – Republic of Armenia</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Not recognised by Pakistan.</td>\n",
       "      <td>Armenia is not recognised by Pakistan due to t...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Artsakh</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Australia – Commonwealth of Australia</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Australia is a Commonwealth realm[e] and a fed...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Austria – Republic of Austria</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Member of the European Union.[c] Austria is a ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Azerbaijan – Republic of Azerbaijan</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Azerbaijan contains one autonomous region, Nak...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Bahamas, The – Commonwealth of The Bahamas[8]</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>The Bahamas is a Commonwealth realm.[e]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Bahrain – Kingdom of Bahrain</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Bangladesh – People's Republic of Bangladesh</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Barbados</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Barbados is a Commonwealth realm.[e]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Belarus – Republic of Belarus</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                              Common and formal names  \\\n",
       "0                                                 NaN   \n",
       "1              UN member states and observer states ↓   \n",
       "2                                            Abkhazia   \n",
       "3       Afghanistan – Islamic Republic of Afghanistan   \n",
       "4                       Albania – Republic of Albania   \n",
       "5   Algeria – People's Democratic Republic of Algeria   \n",
       "6                   Andorra – Principality of Andorra   \n",
       "7                         Angola – Republic of Angola   \n",
       "8                                 Antigua and Barbuda   \n",
       "9                   Argentina – Argentine Republic[g]   \n",
       "10                      Armenia – Republic of Armenia   \n",
       "11                                            Artsakh   \n",
       "12              Australia – Commonwealth of Australia   \n",
       "13                      Austria – Republic of Austria   \n",
       "14                Azerbaijan – Republic of Azerbaijan   \n",
       "15      Bahamas, The – Commonwealth of The Bahamas[8]   \n",
       "16                       Bahrain – Kingdom of Bahrain   \n",
       "17       Bangladesh – People's Republic of Bangladesh   \n",
       "18                                           Barbados   \n",
       "19                      Belarus – Republic of Belarus   \n",
       "\n",
       "   Membership within the UN System[a]       Sovereignty dispute[b]  \\\n",
       "0                                 NaN                          NaN   \n",
       "1                                 NaN                          NaN   \n",
       "2                                 NaN                          NaN   \n",
       "3                     UN member state                          NaN   \n",
       "4                                 NaN                          NaN   \n",
       "5                                 NaN                          NaN   \n",
       "6                                 NaN                          NaN   \n",
       "7                                 NaN                          NaN   \n",
       "8                                 NaN                          NaN   \n",
       "9                                 NaN                          NaN   \n",
       "10                                NaN  Not recognised by Pakistan.   \n",
       "11                                NaN                          NaN   \n",
       "12                                NaN                          NaN   \n",
       "13                                NaN                          NaN   \n",
       "14                                NaN                          NaN   \n",
       "15                                NaN                          NaN   \n",
       "16                                NaN                          NaN   \n",
       "17                                NaN                          NaN   \n",
       "18                                NaN                          NaN   \n",
       "19                                NaN                          NaN   \n",
       "\n",
       "   Further information on status and recognition of sovereignty[d]  \n",
       "0                                                 NaN               \n",
       "1                                                 NaN               \n",
       "2                                                 NaN               \n",
       "3                                                 NaN               \n",
       "4                                                 NaN               \n",
       "5                                                 NaN               \n",
       "6   Andorra is a co-principality in which the offi...               \n",
       "7                                                 NaN               \n",
       "8   Antigua and Barbuda is a Commonwealth realm[e]...               \n",
       "9   Argentina is a federation of 23 provinces and ...               \n",
       "10  Armenia is not recognised by Pakistan due to t...               \n",
       "11                                                NaN               \n",
       "12  Australia is a Commonwealth realm[e] and a fed...               \n",
       "13  Member of the European Union.[c] Austria is a ...               \n",
       "14  Azerbaijan contains one autonomous region, Nak...               \n",
       "15            The Bahamas is a Commonwealth realm.[e]               \n",
       "16                                                NaN               \n",
       "17                                                NaN               \n",
       "18               Barbados is a Commonwealth realm.[e]               \n",
       "19                                                NaN               "
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "result = requests.get('https://en.wikipedia.org/wiki/List_of_sovereign_states')\n",
    "pd.read_html(result.content)[0].head(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For more complex parsing, we can utilize the `BeautifulSoup` library. Let's try to extract the same table, but use the new library. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'<!DOCTYPE html>\\n<html class=\"client-nojs\" dir=\"ltr\" lang=\"en\">\\n<head>\\n<meta charset=\"utf-8\"/>\\n<title>List of sovereign states - Wikipedia</title>\\n<script>document.documentElement.className=\"client-js\";RLCONF={\"wgBreakFrames\":!1,\"wgSeparatorTransformTable\":[\"\",\"\"],\"wgDigitTransformTable\":[\"\",\"\"],\"wgDefaultDateFormat\":\"dmy\",\"wgMonthNames\":[\"\",\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\"wgRequestId\":\"XqsP3wpAAEUAAEGqjmIAAAAR\",\"wgCS'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "soup = BeautifulSoup(result.content, 'lxml') # Parse the HTML as a string\n",
    "str(soup)[:500]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Find the tables."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "tables = soup.find_all('table')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Using the `read_html` function of `pandas`, read the first table into a dataframe."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Common and formal names</th>\n",
       "      <th>Membership within the UN System[a]</th>\n",
       "      <th>Sovereignty dispute[b]</th>\n",
       "      <th>Further information on status and recognition of sovereignty[d]</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>UN member states and observer states ↓</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Abkhazia</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Afghanistan – Islamic Republic of Afghanistan</td>\n",
       "      <td>UN member state</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Albania – Republic of Albania</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Algeria – People's Democratic Republic of Algeria</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Andorra – Principality of Andorra</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Andorra is a co-principality in which the offi...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Angola – Republic of Angola</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Antigua and Barbuda</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Antigua and Barbuda is a Commonwealth realm[e]...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Argentina – Argentine Republic[g]</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Argentina is a federation of 23 provinces and ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Armenia – Republic of Armenia</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Not recognised by Pakistan.</td>\n",
       "      <td>Armenia is not recognised by Pakistan due to t...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Artsakh</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Australia – Commonwealth of Australia</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Australia is a Commonwealth realm[e] and a fed...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Austria – Republic of Austria</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Member of the European Union.[c] Austria is a ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Azerbaijan – Republic of Azerbaijan</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Azerbaijan contains one autonomous region, Nak...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Bahamas, The – Commonwealth of The Bahamas[8]</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>The Bahamas is a Commonwealth realm.[e]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Bahrain – Kingdom of Bahrain</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Bangladesh – People's Republic of Bangladesh</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Barbados</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Barbados is a Commonwealth realm.[e]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Belarus – Republic of Belarus</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                              Common and formal names  \\\n",
       "0                                                 NaN   \n",
       "1              UN member states and observer states ↓   \n",
       "2                                            Abkhazia   \n",
       "3       Afghanistan – Islamic Republic of Afghanistan   \n",
       "4                       Albania – Republic of Albania   \n",
       "5   Algeria – People's Democratic Republic of Algeria   \n",
       "6                   Andorra – Principality of Andorra   \n",
       "7                         Angola – Republic of Angola   \n",
       "8                                 Antigua and Barbuda   \n",
       "9                   Argentina – Argentine Republic[g]   \n",
       "10                      Armenia – Republic of Armenia   \n",
       "11                                            Artsakh   \n",
       "12              Australia – Commonwealth of Australia   \n",
       "13                      Austria – Republic of Austria   \n",
       "14                Azerbaijan – Republic of Azerbaijan   \n",
       "15      Bahamas, The – Commonwealth of The Bahamas[8]   \n",
       "16                       Bahrain – Kingdom of Bahrain   \n",
       "17       Bangladesh – People's Republic of Bangladesh   \n",
       "18                                           Barbados   \n",
       "19                      Belarus – Republic of Belarus   \n",
       "\n",
       "   Membership within the UN System[a]       Sovereignty dispute[b]  \\\n",
       "0                                 NaN                          NaN   \n",
       "1                                 NaN                          NaN   \n",
       "2                                 NaN                          NaN   \n",
       "3                     UN member state                          NaN   \n",
       "4                                 NaN                          NaN   \n",
       "5                                 NaN                          NaN   \n",
       "6                                 NaN                          NaN   \n",
       "7                                 NaN                          NaN   \n",
       "8                                 NaN                          NaN   \n",
       "9                                 NaN                          NaN   \n",
       "10                                NaN  Not recognised by Pakistan.   \n",
       "11                                NaN                          NaN   \n",
       "12                                NaN                          NaN   \n",
       "13                                NaN                          NaN   \n",
       "14                                NaN                          NaN   \n",
       "15                                NaN                          NaN   \n",
       "16                                NaN                          NaN   \n",
       "17                                NaN                          NaN   \n",
       "18                                NaN                          NaN   \n",
       "19                                NaN                          NaN   \n",
       "\n",
       "   Further information on status and recognition of sovereignty[d]  \n",
       "0                                                 NaN               \n",
       "1                                                 NaN               \n",
       "2                                                 NaN               \n",
       "3                                                 NaN               \n",
       "4                                                 NaN               \n",
       "5                                                 NaN               \n",
       "6   Andorra is a co-principality in which the offi...               \n",
       "7                                                 NaN               \n",
       "8   Antigua and Barbuda is a Commonwealth realm[e]...               \n",
       "9   Argentina is a federation of 23 provinces and ...               \n",
       "10  Armenia is not recognised by Pakistan due to t...               \n",
       "11                                                NaN               \n",
       "12  Australia is a Commonwealth realm[e] and a fed...               \n",
       "13  Member of the European Union.[c] Austria is a ...               \n",
       "14  Azerbaijan contains one autonomous region, Nak...               \n",
       "15            The Bahamas is a Commonwealth realm.[e]               \n",
       "16                                                NaN               \n",
       "17                                                NaN               \n",
       "18               Barbados is a Commonwealth realm.[e]               \n",
       "19                                                NaN               "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_html(str(tables[0]))[0].head(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As we can see, the data we get back isn't always perfect, which is what's so nice about APIs instead of parsing HTML. Nevertheless, we would benefit a lot if we simplified this into a function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def dfFromURL(url, tableNumber=1):\n",
    "    soup = BeautifulSoup(requests.get(url).content, 'lxml') # Parse the HTML as a string\n",
    "    tables = soup.find_all('table')\n",
    "    # check table number is within number of tables on the page\n",
    "    assert len(tables) >= tableNumber\n",
    "    return pd.read_html(str(tables[tableNumber-1]))[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can make a pretty simple call to get an HTML table as a dataframe. Let's try it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Date</th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close*</th>\n",
       "      <th>Adj Close**</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Apr 30, 2020</td>\n",
       "      <td>95.60</td>\n",
       "      <td>96.84</td>\n",
       "      <td>94.55</td>\n",
       "      <td>95.76</td>\n",
       "      <td>95.76</td>\n",
       "      <td>17262125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Apr 29, 2020</td>\n",
       "      <td>99.08</td>\n",
       "      <td>99.45</td>\n",
       "      <td>97.27</td>\n",
       "      <td>97.86</td>\n",
       "      <td>97.86</td>\n",
       "      <td>20427700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Apr 28, 2020</td>\n",
       "      <td>97.81</td>\n",
       "      <td>98.36</td>\n",
       "      <td>95.03</td>\n",
       "      <td>95.29</td>\n",
       "      <td>95.29</td>\n",
       "      <td>20238900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Apr 27, 2020</td>\n",
       "      <td>91.94</td>\n",
       "      <td>95.63</td>\n",
       "      <td>91.54</td>\n",
       "      <td>94.62</td>\n",
       "      <td>94.62</td>\n",
       "      <td>22870200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Apr 24, 2020</td>\n",
       "      <td>90.64</td>\n",
       "      <td>91.10</td>\n",
       "      <td>88.49</td>\n",
       "      <td>90.71</td>\n",
       "      <td>90.71</td>\n",
       "      <td>15815300</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           Date   Open   High    Low Close* Adj Close**    Volume\n",
       "0  Apr 30, 2020  95.60  96.84  94.55  95.76       95.76  17262125\n",
       "1  Apr 29, 2020  99.08  99.45  97.27  97.86       97.86  20427700\n",
       "2  Apr 28, 2020  97.81  98.36  95.03  95.29       95.29  20238900\n",
       "3  Apr 27, 2020  91.94  95.63  91.54  94.62       94.62  22870200\n",
       "4  Apr 24, 2020  90.64  91.10  88.49  90.71       90.71  15815300"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prices = dfFromURL('https://finance.yahoo.com/quote/JPM/history?p=JPM')\n",
    "prices.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Got some messy data hear with divs and some disclaimers on the bottom...let's clean it up with a simple `dropna`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Date</th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close*</th>\n",
       "      <th>Adj Close**</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Apr 30, 2020</td>\n",
       "      <td>95.60</td>\n",
       "      <td>96.84</td>\n",
       "      <td>94.55</td>\n",
       "      <td>95.76</td>\n",
       "      <td>95.76</td>\n",
       "      <td>17262125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Apr 29, 2020</td>\n",
       "      <td>99.08</td>\n",
       "      <td>99.45</td>\n",
       "      <td>97.27</td>\n",
       "      <td>97.86</td>\n",
       "      <td>97.86</td>\n",
       "      <td>20427700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Apr 28, 2020</td>\n",
       "      <td>97.81</td>\n",
       "      <td>98.36</td>\n",
       "      <td>95.03</td>\n",
       "      <td>95.29</td>\n",
       "      <td>95.29</td>\n",
       "      <td>20238900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Apr 27, 2020</td>\n",
       "      <td>91.94</td>\n",
       "      <td>95.63</td>\n",
       "      <td>91.54</td>\n",
       "      <td>94.62</td>\n",
       "      <td>94.62</td>\n",
       "      <td>22870200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Apr 24, 2020</td>\n",
       "      <td>90.64</td>\n",
       "      <td>91.10</td>\n",
       "      <td>88.49</td>\n",
       "      <td>90.71</td>\n",
       "      <td>90.71</td>\n",
       "      <td>15815300</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           Date   Open   High    Low Close* Adj Close**    Volume\n",
       "0  Apr 30, 2020  95.60  96.84  94.55  95.76       95.76  17262125\n",
       "1  Apr 29, 2020  99.08  99.45  97.27  97.86       97.86  20427700\n",
       "2  Apr 28, 2020  97.81  98.36  95.03  95.29       95.29  20238900\n",
       "3  Apr 27, 2020  91.94  95.63  91.54  94.62       94.62  22870200\n",
       "4  Apr 24, 2020  90.64  91.10  88.49  90.71       90.71  15815300"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prices = prices.dropna()\n",
    "prices.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Cool! Let's try to get the second table from a website. Let's see what the Cavs record was for the last few seasons:\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FGM</th>\n",
       "      <th>FGA</th>\n",
       "      <th>FG%</th>\n",
       "      <th>3PM</th>\n",
       "      <th>3PA</th>\n",
       "      <th>3P%</th>\n",
       "      <th>FTM</th>\n",
       "      <th>FTA</th>\n",
       "      <th>FT%</th>\n",
       "      <th>2PM</th>\n",
       "      <th>2PA</th>\n",
       "      <th>2P%</th>\n",
       "      <th>SC-EFF</th>\n",
       "      <th>SH-EFF</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>7.9</td>\n",
       "      <td>16.7</td>\n",
       "      <td>47.2</td>\n",
       "      <td>1.5</td>\n",
       "      <td>3.9</td>\n",
       "      <td>38.0</td>\n",
       "      <td>3.5</td>\n",
       "      <td>4.1</td>\n",
       "      <td>84.6</td>\n",
       "      <td>6.4</td>\n",
       "      <td>12.8</td>\n",
       "      <td>50.1</td>\n",
       "      <td>1.242</td>\n",
       "      <td>0.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5.8</td>\n",
       "      <td>13.0</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2.6</td>\n",
       "      <td>7.0</td>\n",
       "      <td>37.4</td>\n",
       "      <td>3.3</td>\n",
       "      <td>3.9</td>\n",
       "      <td>85.4</td>\n",
       "      <td>3.2</td>\n",
       "      <td>6.0</td>\n",
       "      <td>53.7</td>\n",
       "      <td>1.358</td>\n",
       "      <td>0.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>7.3</td>\n",
       "      <td>13.1</td>\n",
       "      <td>55.2</td>\n",
       "      <td>0.5</td>\n",
       "      <td>1.8</td>\n",
       "      <td>28.6</td>\n",
       "      <td>2.5</td>\n",
       "      <td>4.9</td>\n",
       "      <td>51.3</td>\n",
       "      <td>6.8</td>\n",
       "      <td>11.4</td>\n",
       "      <td>59.3</td>\n",
       "      <td>1.333</td>\n",
       "      <td>0.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5.0</td>\n",
       "      <td>11.2</td>\n",
       "      <td>44.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.5</td>\n",
       "      <td>37.1</td>\n",
       "      <td>2.6</td>\n",
       "      <td>3.0</td>\n",
       "      <td>88.4</td>\n",
       "      <td>2.9</td>\n",
       "      <td>5.8</td>\n",
       "      <td>50.9</td>\n",
       "      <td>1.298</td>\n",
       "      <td>0.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4.7</td>\n",
       "      <td>11.8</td>\n",
       "      <td>40.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>5.0</td>\n",
       "      <td>35.5</td>\n",
       "      <td>1.1</td>\n",
       "      <td>1.2</td>\n",
       "      <td>87.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>6.8</td>\n",
       "      <td>43.4</td>\n",
       "      <td>1.041</td>\n",
       "      <td>0.48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>5.1</td>\n",
       "      <td>9.9</td>\n",
       "      <td>51.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.4</td>\n",
       "      <td>39.1</td>\n",
       "      <td>1.7</td>\n",
       "      <td>2.8</td>\n",
       "      <td>61.5</td>\n",
       "      <td>4.9</td>\n",
       "      <td>9.5</td>\n",
       "      <td>51.8</td>\n",
       "      <td>1.217</td>\n",
       "      <td>0.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4.1</td>\n",
       "      <td>9.4</td>\n",
       "      <td>43.7</td>\n",
       "      <td>1.9</td>\n",
       "      <td>4.9</td>\n",
       "      <td>38.3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>67.0</td>\n",
       "      <td>2.2</td>\n",
       "      <td>4.4</td>\n",
       "      <td>49.7</td>\n",
       "      <td>1.179</td>\n",
       "      <td>0.54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4.1</td>\n",
       "      <td>7.7</td>\n",
       "      <td>53.1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.8</td>\n",
       "      <td>35.2</td>\n",
       "      <td>0.9</td>\n",
       "      <td>1.3</td>\n",
       "      <td>67.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>4.9</td>\n",
       "      <td>63.6</td>\n",
       "      <td>1.309</td>\n",
       "      <td>0.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3.7</td>\n",
       "      <td>8.4</td>\n",
       "      <td>44.2</td>\n",
       "      <td>1.1</td>\n",
       "      <td>3.2</td>\n",
       "      <td>33.5</td>\n",
       "      <td>1.5</td>\n",
       "      <td>2.0</td>\n",
       "      <td>72.3</td>\n",
       "      <td>2.7</td>\n",
       "      <td>5.3</td>\n",
       "      <td>50.6</td>\n",
       "      <td>1.183</td>\n",
       "      <td>0.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1.9</td>\n",
       "      <td>4.0</td>\n",
       "      <td>47.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>1.5</td>\n",
       "      <td>35.1</td>\n",
       "      <td>1.3</td>\n",
       "      <td>1.7</td>\n",
       "      <td>73.2</td>\n",
       "      <td>1.4</td>\n",
       "      <td>2.5</td>\n",
       "      <td>55.9</td>\n",
       "      <td>1.406</td>\n",
       "      <td>0.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2.1</td>\n",
       "      <td>4.1</td>\n",
       "      <td>50.8</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.1</td>\n",
       "      <td>19.4</td>\n",
       "      <td>0.6</td>\n",
       "      <td>1.1</td>\n",
       "      <td>51.5</td>\n",
       "      <td>1.9</td>\n",
       "      <td>3.1</td>\n",
       "      <td>61.8</td>\n",
       "      <td>1.208</td>\n",
       "      <td>0.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1.8</td>\n",
       "      <td>5.4</td>\n",
       "      <td>32.6</td>\n",
       "      <td>1.2</td>\n",
       "      <td>4.0</td>\n",
       "      <td>29.7</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.8</td>\n",
       "      <td>30.8</td>\n",
       "      <td>0.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>40.9</td>\n",
       "      <td>0.919</td>\n",
       "      <td>0.44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1.8</td>\n",
       "      <td>4.3</td>\n",
       "      <td>42.7</td>\n",
       "      <td>0.4</td>\n",
       "      <td>1.6</td>\n",
       "      <td>21.5</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.8</td>\n",
       "      <td>71.0</td>\n",
       "      <td>1.5</td>\n",
       "      <td>2.7</td>\n",
       "      <td>55.7</td>\n",
       "      <td>1.064</td>\n",
       "      <td>0.47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>1.9</td>\n",
       "      <td>3.3</td>\n",
       "      <td>56.9</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.9</td>\n",
       "      <td>73.7</td>\n",
       "      <td>1.9</td>\n",
       "      <td>3.3</td>\n",
       "      <td>56.9</td>\n",
       "      <td>1.333</td>\n",
       "      <td>0.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>1.1</td>\n",
       "      <td>3.1</td>\n",
       "      <td>35.4</td>\n",
       "      <td>0.4</td>\n",
       "      <td>1.6</td>\n",
       "      <td>23.1</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.6</td>\n",
       "      <td>86.5</td>\n",
       "      <td>0.7</td>\n",
       "      <td>1.5</td>\n",
       "      <td>48.8</td>\n",
       "      <td>1.011</td>\n",
       "      <td>0.41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0.6</td>\n",
       "      <td>0.9</td>\n",
       "      <td>70.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.5</td>\n",
       "      <td>83.3</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.9</td>\n",
       "      <td>70.0</td>\n",
       "      <td>1.900</td>\n",
       "      <td>0.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0.8</td>\n",
       "      <td>1.1</td>\n",
       "      <td>69.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.3</td>\n",
       "      <td>50.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.8</td>\n",
       "      <td>77.8</td>\n",
       "      <td>1.538</td>\n",
       "      <td>0.77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>0.3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.5</td>\n",
       "      <td>50.0</td>\n",
       "      <td>0.500</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>40.3</td>\n",
       "      <td>87.9</td>\n",
       "      <td>45.8</td>\n",
       "      <td>11.2</td>\n",
       "      <td>31.8</td>\n",
       "      <td>35.1</td>\n",
       "      <td>15.1</td>\n",
       "      <td>19.9</td>\n",
       "      <td>75.8</td>\n",
       "      <td>29.1</td>\n",
       "      <td>56.1</td>\n",
       "      <td>51.9</td>\n",
       "      <td>1.216</td>\n",
       "      <td>0.52</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     FGM   FGA   FG%   3PM   3PA   3P%   FTM   FTA    FT%   2PM   2PA   2P%  \\\n",
       "0    7.9  16.7  47.2   1.5   3.9  38.0   3.5   4.1   84.6   6.4  12.8  50.1   \n",
       "1    5.8  13.0  45.0   2.6   7.0  37.4   3.3   3.9   85.4   3.2   6.0  53.7   \n",
       "2    7.3  13.1  55.2   0.5   1.8  28.6   2.5   4.9   51.3   6.8  11.4  59.3   \n",
       "3    5.0  11.2  44.2   2.0   5.5  37.1   2.6   3.0   88.4   2.9   5.8  50.9   \n",
       "4    4.7  11.8  40.1   1.8   5.0  35.5   1.1   1.2   87.5   3.0   6.8  43.4   \n",
       "5    5.1   9.9  51.2   0.2   0.4  39.1   1.7   2.8   61.5   4.9   9.5  51.8   \n",
       "6    4.1   9.4  43.7   1.9   4.9  38.3   1.0   1.4   67.0   2.2   4.4  49.7   \n",
       "7    4.1   7.7  53.1   1.0   2.8  35.2   0.9   1.3   67.6   3.1   4.9  63.6   \n",
       "8    3.7   8.4  44.2   1.1   3.2  33.5   1.5   2.0   72.3   2.7   5.3  50.6   \n",
       "9    1.9   4.0  47.9   0.5   1.5  35.1   1.3   1.7   73.2   1.4   2.5  55.9   \n",
       "10   2.1   4.1  50.8   0.2   1.1  19.4   0.6   1.1   51.5   1.9   3.1  61.8   \n",
       "11   1.8   5.4  32.6   1.2   4.0  29.7   0.3   0.8   30.8   0.6   1.4  40.9   \n",
       "12   1.8   4.3  42.7   0.4   1.6  21.5   0.6   0.8   71.0   1.5   2.7  55.7   \n",
       "13   1.9   3.3  56.9   0.0   0.0   0.0   0.6   0.9   73.7   1.9   3.3  56.9   \n",
       "14   1.1   3.1  35.4   0.4   1.6  23.1   0.6   0.6   86.5   0.7   1.5  48.8   \n",
       "15   0.0   2.0   0.0   0.0   1.0   0.0   2.0   2.0  100.0   0.0   1.0   0.0   \n",
       "16   0.6   0.9  70.0   0.0   0.0   0.0   0.5   0.5   83.3   0.6   0.9  70.0   \n",
       "17   0.8   1.1  69.2   0.2   0.3  50.0   0.0   0.1    0.0   0.6   0.8  77.8   \n",
       "18   0.3   1.0  25.0   0.0   0.5   0.0   0.0   0.0    0.0   0.3   0.5  50.0   \n",
       "19   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0    0.0   0.0   0.0   0.0   \n",
       "20   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0    0.0   0.0   0.0   0.0   \n",
       "21  40.3  87.9  45.8  11.2  31.8  35.1  15.1  19.9   75.8  29.1  56.1  51.9   \n",
       "\n",
       "    SC-EFF  SH-EFF  \n",
       "0    1.242    0.52  \n",
       "1    1.358    0.55  \n",
       "2    1.333    0.57  \n",
       "3    1.298    0.53  \n",
       "4    1.041    0.48  \n",
       "5    1.217    0.52  \n",
       "6    1.179    0.54  \n",
       "7    1.309    0.60  \n",
       "8    1.183    0.50  \n",
       "9    1.406    0.55  \n",
       "10   1.208    0.53  \n",
       "11   0.919    0.44  \n",
       "12   1.064    0.47  \n",
       "13   1.333    0.57  \n",
       "14   1.011    0.41  \n",
       "15   1.000    0.00  \n",
       "16   1.900    0.70  \n",
       "17   1.538    0.77  \n",
       "18   0.500    0.25  \n",
       "19   0.000    0.00  \n",
       "20   0.000    0.00  \n",
       "21   1.216    0.52  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1 = dfFromURL('https://www.espn.com/nba/team/stats/_/name/cle', 0)\n",
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Collin Sexton PG</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Kevin Love PF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Andre Drummond C *</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Jordan Clarkson PG *</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Darius Garland PG</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Tristan Thompson C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Cedi Osman SF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Larry Nance Jr. PF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Kevin Porter Jr. SG</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Dante Exum PG *</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>John Henson PF *</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Brandon Knight PG *</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Alfonzo McKinnie SF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Ante Zizic C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Matthew Dellavedova PG</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Malik Newman SG</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Tyler Cook PF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Dean Wade PF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Matt Mooney SG</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>J.P. Macura G</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Marques Bolden C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Total</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      Name\n",
       "0         Collin Sexton PG\n",
       "1            Kevin Love PF\n",
       "2       Andre Drummond C *\n",
       "3     Jordan Clarkson PG *\n",
       "4        Darius Garland PG\n",
       "5       Tristan Thompson C\n",
       "6            Cedi Osman SF\n",
       "7       Larry Nance Jr. PF\n",
       "8      Kevin Porter Jr. SG\n",
       "9          Dante Exum PG *\n",
       "10        John Henson PF *\n",
       "11     Brandon Knight PG *\n",
       "12     Alfonzo McKinnie SF\n",
       "13            Ante Zizic C\n",
       "14  Matthew Dellavedova PG\n",
       "15         Malik Newman SG\n",
       "16           Tyler Cook PF\n",
       "17            Dean Wade PF\n",
       "18          Matt Mooney SG\n",
       "19           J.P. Macura G\n",
       "20        Marques Bolden C\n",
       "21                   Total"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2 = dfFromURL('https://www.espn.com/nba/team/stats/_/name/cle', 1)\n",
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>FGM</th>\n",
       "      <th>FGA</th>\n",
       "      <th>FG%</th>\n",
       "      <th>3PM</th>\n",
       "      <th>3PA</th>\n",
       "      <th>3P%</th>\n",
       "      <th>FTM</th>\n",
       "      <th>FTA</th>\n",
       "      <th>FT%</th>\n",
       "      <th>2PM</th>\n",
       "      <th>2PA</th>\n",
       "      <th>2P%</th>\n",
       "      <th>SC-EFF</th>\n",
       "      <th>SH-EFF</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Collin Sexton PG</td>\n",
       "      <td>7.9</td>\n",
       "      <td>16.7</td>\n",
       "      <td>47.2</td>\n",
       "      <td>1.5</td>\n",
       "      <td>3.9</td>\n",
       "      <td>38.0</td>\n",
       "      <td>3.5</td>\n",
       "      <td>4.1</td>\n",
       "      <td>84.6</td>\n",
       "      <td>6.4</td>\n",
       "      <td>12.8</td>\n",
       "      <td>50.1</td>\n",
       "      <td>1.242</td>\n",
       "      <td>0.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Kevin Love PF</td>\n",
       "      <td>5.8</td>\n",
       "      <td>13.0</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2.6</td>\n",
       "      <td>7.0</td>\n",
       "      <td>37.4</td>\n",
       "      <td>3.3</td>\n",
       "      <td>3.9</td>\n",
       "      <td>85.4</td>\n",
       "      <td>3.2</td>\n",
       "      <td>6.0</td>\n",
       "      <td>53.7</td>\n",
       "      <td>1.358</td>\n",
       "      <td>0.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Andre Drummond C *</td>\n",
       "      <td>7.3</td>\n",
       "      <td>13.1</td>\n",
       "      <td>55.2</td>\n",
       "      <td>0.5</td>\n",
       "      <td>1.8</td>\n",
       "      <td>28.6</td>\n",
       "      <td>2.5</td>\n",
       "      <td>4.9</td>\n",
       "      <td>51.3</td>\n",
       "      <td>6.8</td>\n",
       "      <td>11.4</td>\n",
       "      <td>59.3</td>\n",
       "      <td>1.333</td>\n",
       "      <td>0.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Jordan Clarkson PG *</td>\n",
       "      <td>5.0</td>\n",
       "      <td>11.2</td>\n",
       "      <td>44.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.5</td>\n",
       "      <td>37.1</td>\n",
       "      <td>2.6</td>\n",
       "      <td>3.0</td>\n",
       "      <td>88.4</td>\n",
       "      <td>2.9</td>\n",
       "      <td>5.8</td>\n",
       "      <td>50.9</td>\n",
       "      <td>1.298</td>\n",
       "      <td>0.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Darius Garland PG</td>\n",
       "      <td>4.7</td>\n",
       "      <td>11.8</td>\n",
       "      <td>40.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>5.0</td>\n",
       "      <td>35.5</td>\n",
       "      <td>1.1</td>\n",
       "      <td>1.2</td>\n",
       "      <td>87.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>6.8</td>\n",
       "      <td>43.4</td>\n",
       "      <td>1.041</td>\n",
       "      <td>0.48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Tristan Thompson C</td>\n",
       "      <td>5.1</td>\n",
       "      <td>9.9</td>\n",
       "      <td>51.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.4</td>\n",
       "      <td>39.1</td>\n",
       "      <td>1.7</td>\n",
       "      <td>2.8</td>\n",
       "      <td>61.5</td>\n",
       "      <td>4.9</td>\n",
       "      <td>9.5</td>\n",
       "      <td>51.8</td>\n",
       "      <td>1.217</td>\n",
       "      <td>0.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Cedi Osman SF</td>\n",
       "      <td>4.1</td>\n",
       "      <td>9.4</td>\n",
       "      <td>43.7</td>\n",
       "      <td>1.9</td>\n",
       "      <td>4.9</td>\n",
       "      <td>38.3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>67.0</td>\n",
       "      <td>2.2</td>\n",
       "      <td>4.4</td>\n",
       "      <td>49.7</td>\n",
       "      <td>1.179</td>\n",
       "      <td>0.54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Larry Nance Jr. PF</td>\n",
       "      <td>4.1</td>\n",
       "      <td>7.7</td>\n",
       "      <td>53.1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.8</td>\n",
       "      <td>35.2</td>\n",
       "      <td>0.9</td>\n",
       "      <td>1.3</td>\n",
       "      <td>67.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>4.9</td>\n",
       "      <td>63.6</td>\n",
       "      <td>1.309</td>\n",
       "      <td>0.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Kevin Porter Jr. SG</td>\n",
       "      <td>3.7</td>\n",
       "      <td>8.4</td>\n",
       "      <td>44.2</td>\n",
       "      <td>1.1</td>\n",
       "      <td>3.2</td>\n",
       "      <td>33.5</td>\n",
       "      <td>1.5</td>\n",
       "      <td>2.0</td>\n",
       "      <td>72.3</td>\n",
       "      <td>2.7</td>\n",
       "      <td>5.3</td>\n",
       "      <td>50.6</td>\n",
       "      <td>1.183</td>\n",
       "      <td>0.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Dante Exum PG *</td>\n",
       "      <td>1.9</td>\n",
       "      <td>4.0</td>\n",
       "      <td>47.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>1.5</td>\n",
       "      <td>35.1</td>\n",
       "      <td>1.3</td>\n",
       "      <td>1.7</td>\n",
       "      <td>73.2</td>\n",
       "      <td>1.4</td>\n",
       "      <td>2.5</td>\n",
       "      <td>55.9</td>\n",
       "      <td>1.406</td>\n",
       "      <td>0.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>John Henson PF *</td>\n",
       "      <td>2.1</td>\n",
       "      <td>4.1</td>\n",
       "      <td>50.8</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.1</td>\n",
       "      <td>19.4</td>\n",
       "      <td>0.6</td>\n",
       "      <td>1.1</td>\n",
       "      <td>51.5</td>\n",
       "      <td>1.9</td>\n",
       "      <td>3.1</td>\n",
       "      <td>61.8</td>\n",
       "      <td>1.208</td>\n",
       "      <td>0.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Brandon Knight PG *</td>\n",
       "      <td>1.8</td>\n",
       "      <td>5.4</td>\n",
       "      <td>32.6</td>\n",
       "      <td>1.2</td>\n",
       "      <td>4.0</td>\n",
       "      <td>29.7</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.8</td>\n",
       "      <td>30.8</td>\n",
       "      <td>0.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>40.9</td>\n",
       "      <td>0.919</td>\n",
       "      <td>0.44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Alfonzo McKinnie SF</td>\n",
       "      <td>1.8</td>\n",
       "      <td>4.3</td>\n",
       "      <td>42.7</td>\n",
       "      <td>0.4</td>\n",
       "      <td>1.6</td>\n",
       "      <td>21.5</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.8</td>\n",
       "      <td>71.0</td>\n",
       "      <td>1.5</td>\n",
       "      <td>2.7</td>\n",
       "      <td>55.7</td>\n",
       "      <td>1.064</td>\n",
       "      <td>0.47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Ante Zizic C</td>\n",
       "      <td>1.9</td>\n",
       "      <td>3.3</td>\n",
       "      <td>56.9</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.9</td>\n",
       "      <td>73.7</td>\n",
       "      <td>1.9</td>\n",
       "      <td>3.3</td>\n",
       "      <td>56.9</td>\n",
       "      <td>1.333</td>\n",
       "      <td>0.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Matthew Dellavedova PG</td>\n",
       "      <td>1.1</td>\n",
       "      <td>3.1</td>\n",
       "      <td>35.4</td>\n",
       "      <td>0.4</td>\n",
       "      <td>1.6</td>\n",
       "      <td>23.1</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.6</td>\n",
       "      <td>86.5</td>\n",
       "      <td>0.7</td>\n",
       "      <td>1.5</td>\n",
       "      <td>48.8</td>\n",
       "      <td>1.011</td>\n",
       "      <td>0.41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Malik Newman SG</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Tyler Cook PF</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.9</td>\n",
       "      <td>70.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.5</td>\n",
       "      <td>83.3</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.9</td>\n",
       "      <td>70.0</td>\n",
       "      <td>1.900</td>\n",
       "      <td>0.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Dean Wade PF</td>\n",
       "      <td>0.8</td>\n",
       "      <td>1.1</td>\n",
       "      <td>69.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.3</td>\n",
       "      <td>50.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.8</td>\n",
       "      <td>77.8</td>\n",
       "      <td>1.538</td>\n",
       "      <td>0.77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Matt Mooney SG</td>\n",
       "      <td>0.3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.5</td>\n",
       "      <td>50.0</td>\n",
       "      <td>0.500</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>J.P. Macura G</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Marques Bolden C</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Total</td>\n",
       "      <td>40.3</td>\n",
       "      <td>87.9</td>\n",
       "      <td>45.8</td>\n",
       "      <td>11.2</td>\n",
       "      <td>31.8</td>\n",
       "      <td>35.1</td>\n",
       "      <td>15.1</td>\n",
       "      <td>19.9</td>\n",
       "      <td>75.8</td>\n",
       "      <td>29.1</td>\n",
       "      <td>56.1</td>\n",
       "      <td>51.9</td>\n",
       "      <td>1.216</td>\n",
       "      <td>0.52</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      Name   FGM   FGA   FG%   3PM   3PA   3P%   FTM   FTA  \\\n",
       "0         Collin Sexton PG   7.9  16.7  47.2   1.5   3.9  38.0   3.5   4.1   \n",
       "1            Kevin Love PF   5.8  13.0  45.0   2.6   7.0  37.4   3.3   3.9   \n",
       "2       Andre Drummond C *   7.3  13.1  55.2   0.5   1.8  28.6   2.5   4.9   \n",
       "3     Jordan Clarkson PG *   5.0  11.2  44.2   2.0   5.5  37.1   2.6   3.0   \n",
       "4        Darius Garland PG   4.7  11.8  40.1   1.8   5.0  35.5   1.1   1.2   \n",
       "5       Tristan Thompson C   5.1   9.9  51.2   0.2   0.4  39.1   1.7   2.8   \n",
       "6            Cedi Osman SF   4.1   9.4  43.7   1.9   4.9  38.3   1.0   1.4   \n",
       "7       Larry Nance Jr. PF   4.1   7.7  53.1   1.0   2.8  35.2   0.9   1.3   \n",
       "8      Kevin Porter Jr. SG   3.7   8.4  44.2   1.1   3.2  33.5   1.5   2.0   \n",
       "9          Dante Exum PG *   1.9   4.0  47.9   0.5   1.5  35.1   1.3   1.7   \n",
       "10        John Henson PF *   2.1   4.1  50.8   0.2   1.1  19.4   0.6   1.1   \n",
       "11     Brandon Knight PG *   1.8   5.4  32.6   1.2   4.0  29.7   0.3   0.8   \n",
       "12     Alfonzo McKinnie SF   1.8   4.3  42.7   0.4   1.6  21.5   0.6   0.8   \n",
       "13            Ante Zizic C   1.9   3.3  56.9   0.0   0.0   0.0   0.6   0.9   \n",
       "14  Matthew Dellavedova PG   1.1   3.1  35.4   0.4   1.6  23.1   0.6   0.6   \n",
       "15         Malik Newman SG   0.0   2.0   0.0   0.0   1.0   0.0   2.0   2.0   \n",
       "16           Tyler Cook PF   0.6   0.9  70.0   0.0   0.0   0.0   0.5   0.5   \n",
       "17            Dean Wade PF   0.8   1.1  69.2   0.2   0.3  50.0   0.0   0.1   \n",
       "18          Matt Mooney SG   0.3   1.0  25.0   0.0   0.5   0.0   0.0   0.0   \n",
       "19           J.P. Macura G   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   \n",
       "20        Marques Bolden C   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   \n",
       "21                   Total  40.3  87.9  45.8  11.2  31.8  35.1  15.1  19.9   \n",
       "\n",
       "      FT%   2PM   2PA   2P%  SC-EFF  SH-EFF  \n",
       "0    84.6   6.4  12.8  50.1   1.242    0.52  \n",
       "1    85.4   3.2   6.0  53.7   1.358    0.55  \n",
       "2    51.3   6.8  11.4  59.3   1.333    0.57  \n",
       "3    88.4   2.9   5.8  50.9   1.298    0.53  \n",
       "4    87.5   3.0   6.8  43.4   1.041    0.48  \n",
       "5    61.5   4.9   9.5  51.8   1.217    0.52  \n",
       "6    67.0   2.2   4.4  49.7   1.179    0.54  \n",
       "7    67.6   3.1   4.9  63.6   1.309    0.60  \n",
       "8    72.3   2.7   5.3  50.6   1.183    0.50  \n",
       "9    73.2   1.4   2.5  55.9   1.406    0.55  \n",
       "10   51.5   1.9   3.1  61.8   1.208    0.53  \n",
       "11   30.8   0.6   1.4  40.9   0.919    0.44  \n",
       "12   71.0   1.5   2.7  55.7   1.064    0.47  \n",
       "13   73.7   1.9   3.3  56.9   1.333    0.57  \n",
       "14   86.5   0.7   1.5  48.8   1.011    0.41  \n",
       "15  100.0   0.0   1.0   0.0   1.000    0.00  \n",
       "16   83.3   0.6   0.9  70.0   1.900    0.70  \n",
       "17    0.0   0.6   0.8  77.8   1.538    0.77  \n",
       "18    0.0   0.3   0.5  50.0   0.500    0.25  \n",
       "19    0.0   0.0   0.0   0.0   0.000    0.00  \n",
       "20    0.0   0.0   0.0   0.0   0.000    0.00  \n",
       "21   75.8  29.1  56.1  51.9   1.216    0.52  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.concat((df2, df1), axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
